<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class CollectionCode extends Model
{
    protected $table = 'ims_yz_store_collection_code';
    public $timestamps = true;
    protected $guarded = [''];

    /**
     * 时间戳字段使用整数类型
     */
    protected $dateFormat = 'U';

    /**
     * 查询门店二维码
     * @param $id
     * @param $type
     * @return CollectionCode|null
     */
    public static function getStoreCode($id, $type)
    {
        return self::where('store_id', $id)->where('type', $type)->first();
    }
}
